package itman.controller;

import itman.po.Food;
import itman.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/FoodController")
public class FoodController {
    @Autowired
    private FoodService foodService;

    /**
     * 根据商家编号查询所属食品信息
     * @param food
     * @return
     */
    @RequestMapping("/listFoodByBusinessId")
    public List<Food>listFoodByBusinessId(Food food ){
        return foodService.listFoodByBusinessId(food.getBusinessId());
    }
}
